#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <string.h>
#include <ctype.h>
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netdb.h>
#include <errno.h>

/*-- TODO:Podria usar enums --*/
#define CONNECTION_OK 0
#define CONNECTION_LISTEN_OK 1

#define CONNECTION_SOCKET_ERROR -1
#define CONNECTION_CONNECT_ERROR -2
#define CONNECTION_BIND_ERROR -3
#define CONNECTION_LISTEN_ERROR -4


/***********************************************************
 *
 *	FUNCIONES
 *
 ***********************************************************/

/*-- Shortcut para connect --*/
int tryToConnect(unsigned int* puertodestino, unsigned char* ipdestino, short int* socketaasociar);

/*-- Shortcut para connect --*/
int prepareListenPort(unsigned short int port, short int* socket);
